Added comment
authorJeroen van der Heijden <jeroen@transceptor.technology>
Fri, 18 May 2018 08:31:57 +0000 (10:31 +0200)
committerJeroen van der Heijden <jeroen@transceptor.technology>
Fri, 18 May 2018 08:31:57 +0000 (10:31 +0200)
src/siri/db/series.c

index 71388d12296a0d4c5fd85e304d17ff3552efbb32..8f54c6151dec0847bac322ca6ddbcb42798b3e74 100644 (file)
@@ -884,8 +884,13 @@ siridb_points_t * siridb_series_get_last(
 
     (*required_shard)++;
 
+
+#if DEBUG
     /* if not in the buffer, then if must be in a shard */
     assert (series->idx_len);
+#endif
+
+    /* if not in the buffer, then if must be in a shard */
 
     size_t i = series->idx_len - 1;
     idx_t * idx = series->idx + i;
@@ -912,7 +917,11 @@ siridb_points_t * siridb_series_get_last(
             NULL,
             series->flags & SIRIDB_SERIES_HAS_OVERLAP);
 
+#if DEBUG
+    /* we must have at least one point, more points are possible when
+     * having multiple points at the same time-stamp. */
     assert (points->len);
+#endif
 
     while (points->len > 1)
     {